<ui:composition template="/admin/templates/ui2.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite/primefaces"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<f:metadata>
		<f:viewParam name="id" value="#{huaxiOrgHome.id}"></f:viewParam>
	</f:metadata>
	<f:metadata>
		<f:viewParam name="typeId" value="#{huaxiOrgHome.instance.orgType.id}"></f:viewParam>
	</f:metadata>

	<ui:define name="content">

		

		<div class="entry">
			<p:toolbar styleClass="admin-nav-toolbar">
				<p:toolbarGroup>
					<h:outputLabel
						value="#{commonMsg.currentPositionLabel} 增加机构"></h:outputLabel>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:separator />
					<p:button value="机构列表"
						outcome="/admin/huaxi/huaxiOrgList"></p:button>
				</p:toolbarGroup>
			</p:toolbar>
			<p:spacer></p:spacer>
			<h:form id="form">
				<h:inputHidden value="#{huaxiOrgHome.id}"></h:inputHidden>
				<h:panelGrid columns="2" columnClasses="col1,col2" id="panel">
					<h:outputLabel value="编号"
						styleClass="form-input-label"></h:outputLabel>
					<h:inputText value="#{huaxiOrgHome.instance.id}"
						readonly="#{not empty huaxiOrgHome.instance.id}"
						label="#{commonMsg.IDLabel}" id="huaxiOrgId" required="true"
						requiredMessage="#{commonMsg.IdRequired}"></h:inputText>

					<h:outputLabel value="机构名称"
						styleClass="form-input-label"></h:outputLabel>
					<h:inputText value="#{huaxiOrgHome.instance.orgName}" required="true"
						label="机构名称"></h:inputText>

					
					<h:outputLabel value="机构类别"></h:outputLabel>
					<h:selectOneMenu required="true" label="呵呵" value="#{huaxiOrgHome.instance.orgType}" converter="archer.EntityConverter">
						<f:selectItem itemValue="" itemLabel="请选择"/>
						<f:selectItems var="p" value="#{orgTypeList.allResult}"
							itemLabel="#{p.name}" itemValue="#{p}"/>
						
					</h:selectOneMenu>
						
						
					<h:outputLabel value="上级机构"
						styleClass="form-input-label"></h:outputLabel>
					<h:selectOneMenu id="orgTree" 
						value="#{huaxiOrgHome.instance.parent.id}"
						label="上级机构">
						<f:selectItem itemValue="" itemLabel="#{menuMsg.hasNot}" />
						<f:selectItems value="#{huaxiOrgList.getOrgTree()}" var="m"
							itemValue="#{m.id}" itemLabel="#{m.label}" />
					</h:selectOneMenu>
					
					<h:outputLabel value="操作"></h:outputLabel>
					<ui:fragment>
						<p:commandButton value="#{commonMsg.saveLabel}"
							action="#{huaxiOrgHome.save()}" id="saveBtn"></p:commandButton>
						<p:commandButton type="reset" value="#{commonMsg.resetLabel}"></p:commandButton>
					</ui:fragment>
					<p:blockUI block="panel" trigger="saveBtn" />
				</h:panelGrid>

				
			</h:form>
		</div>
	</ui:define>
</ui:composition>